import sys
from PyQt5.QtWidgets import QApplication

from control.main_control import new_click, about_click, reset_click, run_fcfs_click, run_sjf_click, setting_click
from gui.ui_main import TopBarParams, UI_Main
from var import screen

if __name__ == '__main__':
    mainApp = QApplication(sys.argv)

    UI = UI_Main()

    top_bar_params = TopBarParams(newListener=new_click, aboutListener=about_click, resetListener=reset_click,
                                  fcfs_runListener=run_fcfs_click, sjf_runListener=run_sjf_click,
                                  settingListener=setting_click)
    mainWin = UI.CreateMainWindow(screen, top_bar_params)

    mainWin.show()

    sys.exit(mainApp.exec())
